package com.yjd.comm.wal.service;

import java.util.Map;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.wal.model.WalAccountModel;
import com.yjd.comm.wal.model.WalProjectModel;

/**
 * <b>description</b>：小钱包账户业务接口<br>
 * <b>time</b>：2015-08-19 10:54:55 <br>
 * <b>author</b>：  nmd
 */
public interface IWalAccountService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public WalAccountModel insert(WalAccountModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(WalAccountModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception;

	
	
	/**
	 * 医界贷账户转账到小钱包
	 * @param user_id
	 * @param transMoney
	 * @return
	 * @throws Exception
	 */
	public boolean yjdFundsToWalAccount(Long user_id,Double transMoney,Long pid) throws Exception;

	
	/**
	 * 小钱包资金转出到医界贷账户,大于等于1表示成功，其他失败
	 * @param userId
	 * @param money
	 * @return
	 * @throws Exception
	 */
	public int walTurnIntoYjd(Long userId,Double money) throws Exception;

	/**
	 * 
	* 小钱包标的信息判断
	* @param pid
	* @param transMoney
	* @param currTime
	* @return
	* @throws Exception
	 */
	public WalProjectModel validatePid(Long pid,Double transMoney, Long currTime) throws Exception ;
	/**
	 * 
	* 小钱包收益发放
	* @param user_id
	* @param time
	* @throws Exception
	 */
	public void payProfit(Long user_id,Long time) throws Exception;
	
	/**
	 * 修改募集项目状态
	 * @param pid
	 * @param currTime
	 * @throws Exception
	 */
	public void changeCollectFinsh(Long pid,Long currTime) throws Exception ;
	
	/**
	 * 查询带匹配的资金总额
	* @return
	* @throws Exception
	* int
	 */
	public double getTotalWaitPrice() throws Exception;
	/**
	 * 得到全部小钱包用户数
	 * @param param
	 * @return int
	 * @throws Exception
	 * @exception
	 * @since  1.0.0
	 */
	public int getCountAccount(Map param)  throws Exception;
	/**
	 * 得到全部收益金额
	 * @param param
	 * @return
	 * @throws Exception
	 *double
	 * @exception
	 * @since  1.0.0
	 */
	public Double getSumProfit(Map param)  throws Exception;
}
